package com.lwc.controller;

import com.lwc.bean.TaoCan;
import com.lwc.common.bean.ResultBean;
import com.lwc.common.controller.BaseController;
import com.lwc.service.TaoCanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "套餐")
@RequestMapping("/api")
public class TaoCanController extends BaseController {

    @Autowired
    TaoCanService taoCanService;

    @ApiOperation("保存套餐")
@PostMapping("/save")
    public ResultBean save(@RequestBody List<TaoCan> taoCanList){
        taoCanService.save(taoCanList);
return success("保存成功");

    }
    @ApiOperation("查询套餐列表")
    @GetMapping("/query")
    public ResultBean<TaoCan> query(){
List<TaoCan>list=taoCanService.query();
return success("查询成功",list);
    }



}
